from rest_framework import serializers
from SearchHospital.models import DepartmentModel, HospitalModel

# 科室表序列化器
class DepartmentModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = DepartmentModel
        fields = [
            'id', 
            'name'
        ]

# 医院表序列化器
class HospitalModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = HospitalModel
        fields = [
            'id', 
            'name', 
            'hospital_number', 
            'address', 
            'contact_info', 
            'establishment_year', 
            'director', 
            'service_scope', 
            'featured_specialties', 
            'title', 
            'official_website', 
            'work_hours', 
            'description', 
            'department', 
            'doctors'
        ]